Purpose
Enter grid values

Solution
Use the predefined VB function
  
GuiXT

guinet.GridControl.SetCellValue

Please note: This function is useful for entering a couple of values into a grid, but is too slow for large amounts of data  (see video).


Example

IIn transaction IW37N we add a button "Lock selected orders". Before locking the orders we display a warning message which contains the order numbers and the short text for each order selected.


IW37N, warning message before locking the selected orders


GuiXT
Pushbutton (toolbar) "Lock selected orders" process="lock_orders.txt"
InputScript  "lock_orders.txt" 

// -----------------------------
// lock selected orders in IW37N
// ------------------------------

Screen saplslvc_fullscreen.0500

  // collect selected rows
  CallVBAsync selrows = guinet.GridControl.GetSelectedRows _
     colids:="AUFNR,KTEXT" delimiter:=" "

  Enter

Screen saplslvc_fullscreen.0500

 // any rows selected? else no action
  if not V[selrows]
    Message "W: No rows selected" -statusline
    Enter
    Leave
  endif

  Setet text[msg] "Do you want to lock the following orders:\n\n"
  CopyText fromText="_grid_selected_values" toText="msg" -appendLine

 // display warning message
  Message "&text[msg]" -yesno title="Lock orders"

 // continue? else no action
  if not Q[ok]
    Enter
    Leave
  endif

 // Process detail screen for each order
  Enter "=IOBJ"

label next_order
Screen saplcoih.3000

 // display title during processing
  Title "Please wait... Locking order &F[CAUFVD-AUFNR.2] &F[CAUFVD-KTEXT]"

 // lock the order
  Enter "=SPER"

 goto next_order

Components
InputAssistant + Controls